#ifndef PREF_MIGEMO_H_
#define PREF_MIGEMO_H_

#include "p_widgets.h"

namespace gpyp {
namespace pref {

class Migemo : public Gtk::VBox {
private:
  Application           &app_;
  Gtk::Window           &parent_;

  Gtk::RadioButtonGroup  rbg_mode_;
  Gtk::RadioButton       mode_disabled_;
  Gtk::RadioButton       mode_cmigemo_;
  Gtk::RadioButton       mode_migemosrv_;
  autoconn               conn_mode_changed_;

  Gtk::ComboBoxEntryText encoding_;
  Gtk::SpinButton        min_length_;

  Gtk::Frame             cmigemo_;
  FileEntry              dict_;
  FileEntry              dict_user_;

  Gtk::Frame             migemosrv_;
  Gtk::Entry             url_;

  Gtk::Frame             test_;
  Gtk::Entry             test_from_;
  Gtk::Entry             test_to_;

  autoconn               conn_enable_migemo_changed_;

private:
  void update_option_sensitive();

  void mode_disabled_on_toggled();
  void mode_cmigemo_on_toggled();
  void mode_migemosrv_on_toggled();

  void migemo_mode_on_changed();

  void open(Gtk::Entry &entry);

  void dict_open_on_clicked();
  void dict_user_open_on_clicked();

  void search_on_enable_migemo_changed();
  void test_from_on_changed();

public:
  Migemo(Application &app, Gtk::Window &parent);
};

}/*pref*/
}/*gpyp*/

#endif/*PREF_MIGEMO_H_*/
